<template>
  <div class="buttonGroup">
    <div class="back" @click="goHome">
      <el-button type="primary" round>
        <SvgIcon name="back" /><span>返回首页</span></el-button
      >
    </div>
    <div class="guidetxt"><span>Ai导诊</span></div>
    <div class="create">
      <el-button type="success" round @click="createDialogue">
        <SvgIcon name="create" />
        <span>创建新对话</span>
      </el-button>
    </div>
  </div>
</template>
<script lang="ts" setup>
import { useRouter } from "vue-router";
import { localStorageUtil } from "@/utils/localStorageUtil";
import { ref } from "vue";
const router = useRouter();
const emit = defineEmits(["create"]);
const props = defineProps({
  onCreate: {
    type: Function,
    // required: true,
  },
});
const goHome = () => {
  router.push("/home");
  localStorageUtil.clear();
};
const createDialogue = () => {
  console.log("点击了创建新对话");
  emit("create");
  // props.onCreate();
};
</script>
<style lang="scss" scoped>
@import "./styles/mixins.scss";
.buttonGroup {
  display: flex;
  justify-content: space-between;
  padding: 24px 30px;
  margin: 30px 0;

  .back {
    @include buttons;
  }
  .create {
    @include buttons;
  }
  .guidetxt {
    position: relative;

    width: 160px;
    height: 60px;
    span {
      font-size: 40px;
      color: #000000;
      position: absolute;
      bottom: 0;
    }
  }
}
</style>
